.PHONY: clean clean_all

CC = cl.exe
LINK = link.exe
RM = del

PROJECT = room

OBJS = main.obj winmain.obj RoomWindow.obj BaseWindow.obj BaseApp.obj\
	   utils.obj	
LIBS = kernel32.lib user32.lib gdi32.lib v8.lib

LIBPATH = /LIBPATH:..\lib
INCPATH = /I.

SUBSYSTEM = console

CFLAGS = /nologo /c /EHs /MD /Zi /TP /D_UNICODE /DUNICODE
LFLAGS = /nologo /debug /subsystem:${SUBSYSTEM} /out:${PROJECT}.exe

$(PROJECT).exe: $(OBJS)
	$(LINK) $(LFLAGS) $(LIBPATH) $(LIBS) $^

$(PROJECT).pch: room_pch.h room_pch.cpp common.h
	$(CC) $(CFLAGS) $(INCPATH) /Ycroom_pch.h /Fp$(PROJECT).pch room_pch.cpp

%.obj: %.cpp $(PROJECT).pch
	$(CC) $(CFLAGS) $(INCPATH) /Yuroom_pch.h /Fp$(PROJECT).pch $<

#
# dependency
#
main.obj: RoomWindow.h BaseApp.h 

clean:
	$(RM) *.exe *.obj

clean_all: clean
	$(RM) *.pdb *.ilk *.pch

